<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>班级信息</title>
</head>
<body>
    <table>
        <tr>
            <th>班级名称</th>
        </tr>
        <tr>
            <td id="app-1"></td>
        </tr>
    </table>
    <input type="submit" value="返回首页" onclick="location.href='/'">
</body>
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    <script>
        $.ajax(
            {
                url: "http://127.0.0.1:8000/api/grade/",
                type: "get",
                async: false,
                dataType: 'json',
                success: function (data) {
                    console.log(data)
                    data.forEach(function (item, x, arr){
                        pNode = $('<p></p>')
                        pNode.text(item['grade_name'])
                        $('#app-1').append(pNode)
                    })
                    }
                }
        )
    </script>

</html>